import type { RouteRecordRaw } from 'vue-router';

// 需要从设置的lang/index中获取配置的i18n
import { i18n } from '@/lang/index'
const { t } = i18n.global

//静态路由（默认路由）
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: () => import('@/views/home.vue'),
    redirect: '/home/task',
    children: [
      {
        path: '/home/task',
        name: 'task',
        component: () => import('@/views/task/index.vue'),
        meta: {
          title: '任务管理',
        }
      },
      {
        path: '/home/task/taskMate',
        name: 'taskMate',
        component: () => import('@/views/task/taskMate/index.vue'),
        meta: {
          title: '任务匹配',
        }
      },
      {
        path: '/home/task/taskDetail',
        name: 'taskDetail',
        component: () => import('@/views/task/taskDetail/index.vue'),
        meta: {
          title: '任务详情',
        }
      },
      {
        path: '/home/backVisit',
        name: 'backVisit',
        component: () => import('@/views/backVisit/index.vue'),
        meta: {
          title: '回访管理',
        }
      },
      {
        path: '/home/backVisit/backVisitDetail',
        name: 'backVisitDetail',
        component: () => import('@/views/backVisit/backVisitDetail/index.vue'),
        meta: {
          title: '回访详情',
        },
      },
      {
        path: '/home/user',
        name: 'user',
        component: () => import('@/views/user/index.vue'),
        meta: {
          title: '用户管理',
        }
      },
      {
        path: '/home/message',
        name: 'message',
        component: () => import('@/views/message/index.vue'),
        meta: {
          title: '信息查询',
        },
      },
      {
        path: '/home/message/messageDetail',
        name: 'messageDetail',
        component: () => import('@/views/message/messageDetail/index.vue'),
        meta: {
          title: '信息详情',
        },
      },
      {
        path: '/home/mate',
        name: 'mate',
        component: () => import('@/views/mate/index.vue'),
        meta: {
          title: '匹配管理',
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login.vue'),
    meta: {
      title: '登录',
    }
  },
  {
    path: '/forgot',
    name: 'forgot',
    component: () => import('@/views/forgot.vue'),
    meta: {
      title: '忘记密码',
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/404.vue'),
    meta: {
      title: t('router.404'),
    }
  },
  {
    path: '/403',
    name: '403',
    component: () => import('@/views/403.vue'),
    meta: {
      title: t('router.403'),
    }
  },
  {
    path: '/500',
    name: '500',
    component: () => import('@/views/500.vue'),
    meta: {
      title: t('router.500'),
    }
  },
];



